<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>DP统一认证中心</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
    <link rel="stylesheet" href="${ctxPath}/static/css/login.min.css"/>
</head>
<body>
<div class="login">
    <div class="message">DP统一认证中心</div>
    <div id="darkbannerwrap"></div>
    <form action="${ctxPath}/login" method="post" id="loginForm">
        <h4 class="tip">${errorMsg!}</h4>
        <input placeholder="用户名" id="username" name="username" type="text">
        <hr class="hr15">
        <input placeholder="密码" id="password" name="password" type="password">
        <hr class="hr15">
        <label>
            <input type="checkbox" name="rememberMe"> 记住密码
        </label>
        <hr class="hr15">
        <input value="登录" style="width: 100%;" type="button" id="loginBtn">
        <hr class="hr20">
        <p class="copyright">
            版权所有 © 2018 DP-BOOT - Powered By Mr.Lin
        </p>
        <input type="hidden" name="service" value="${service!}">
    </form>
</div>
<script src="${ctxPath}/static/libs/jquery.min.js"></script>
<script type="text/javascript">

    $(function () {
        if (self != top) {
            top.location.href = self.location.href;
        }
        $('#loginBtn').on('click', login);
        $(document).keyup(function (event) {
            if (event.keyCode === 13) {
                $('#loginBtn').trigger('click');
            }
        })
    });

    function login() {
        var username = $('#username').val();
        if (username === '') {
            $('.tip').text('用户名不能为空');
            return false;
        }
        var password = $('#password').val();
        if (password === '') {
            $('.tip').text('密码不能为空');
            return false;
        }
        $('#loginForm').submit();
    }
</script>
</body>
</html>
